import Vue from "vue";

import "normalize.css/normalize.css"; // A modern alternative to CSS resets
import "font-awesome/css/font-awesome.min.css"; // font-awesome icon库
import "./assets/icon/iconfont.css"; // 阿里巴巴矢量图标库
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import locale from "element-ui/lib/locale/lang/zh-CN"; // lang i18n
import _ from "lodash";
import "../public/mxgraph/css/mxgraph.css";
import "../public/mxgraph/css/style.scss";
import "@/styles/index.scss"; // global css
// import ace from 'ace-builds'
import App from "./App";
import store from "./store";
import router from "./router";
// 打印import Print from 'vue-print-nb'
// import Print from 'vue-print-nb'
// Vue.use(Print)
// import fullscreen from "vue-fullscreen";
// Vue.use(fullscreen);
// import Print from "@/utils/print";
// Vue.use(Print);
// 自定义指令,计算表格高度
import InitScreenH from "@/directives/initScreenH.js";
Vue.use(InitScreenH); //  v-init-screen-h
// import draggable from '@/directive/draggable'
// Vue.directive('draggable', draggable)
// Vue.use(draggable); //  v-init-screen-h
// import adaptive from '@/directive'
// Vue.use(adaptive)
import Directives from "./directives";
Vue.use(Directives);
// import Tooltip from "vue-directive-tooltip";
// import "vue-directive-tooltip/dist/vueDirectiveTooltip.css";
// Vue.use(Tooltip);
//echarts
import * as echarts from "echarts";
// 引用API文件
import api from "./api/index.js";
import { regTextName } from "./utils/index";
import "@/icons"; // icon
import "@/permission"; // permission control
import "./utils/dialog"; //dialog弹窗拖拽
import moment from "moment";
//leaflet地图
// import "leaflet/dist/leaflet.css";
// 引入Leaflet对象 挂载到Vue上，便于全局使用，也可以单独页面中单独引用
// import * as L from "leaflet";
// import "leaflet.pm";
// import "leaflet.pm/dist/leaflet.pm.css";
import "@/assets/style/flex.scss";

import x2js from "x2js";
// import Clipboard from 'clipboard'; //复制文本插件
import "./assets/style/gobal.css"; //element全局样式
//全局过滤器
import * as filters from "./filter/index";
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});
/* leaflet icon */
// delete L.Icon.Default.prototype._getIconUrl;
// L.Icon.Default.mergeOptions({
//   iconRetinaUrl: require("leaflet/dist/images/marker-icon-2x.png"),
//   iconUrl: require("leaflet/dist/images/marker-icon.png"),
//   shadowUrl: require("leaflet/dist/images/marker-shadow.png")
// });

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// let stream = require("stream");
// const Excel = require('exceljs')
// import Excel from "exceljs";
Vue.prototype.$Minio = require("minio");
Vue.prototype.$stream = require("stream");
// import pdf from "vue-pdf-signature";

// Vue.prototype.$pdf = pdf
// Vue.prototype.$Excel = Excel
// 将API方法绑定到全局
Vue.prototype.$api = api;
// 名称校验
Vue.prototype.$regTextName = regTextName;
//将echarts方法绑定到全局
Vue.prototype.$echarts = echarts;
// set ElementUI lang to EN
ElementUI.Dialog.props.lockScroll.default = false;
Vue.use(ElementUI, { locale });
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)
Vue.prototype._ = _;
Vue.config.productionTip = false;
// Vue.use(ace)
moment.locale("zh-cn"); //汉化
Vue.prototype.$moment = moment;

// 全局的msg二次封装
import eleglobal from "@/utils/eleglobal";
Vue.use(eleglobal);
// Vue.prototype.Clipboard = Clipboard;

import * as R from "ramda";
Vue.prototype.R = R;
Vue.prototype.$x2js = new x2js();

// datav按需加载 (没使用的组件不会被打包)
// import {
//   borderBox12,
//   percentPond,
//   borderBox7,
//   borderBox10,
//   loading,
//   digitalFlop,
//   borderBox13,
//   borderBox1,
//   decoration1,
//   decoration12,
//   decoration9,
//   decoration10,
//   decoration8,
//   decoration11,
//   decoration6,
//   decoration7
// } from "@jiaminghi/data-view";

// Vue.use(borderBox12)
//   .use(borderBox7)
//   .use(borderBox10)
//   .use(loading)
//   .use(digitalFlop)
//   .use(borderBox1)
//   .use(decoration9)
//   .use(decoration1)
//   .use(borderBox13)
//   .use(decoration12)
//   .use(decoration10)
//   .use(decoration8)
//   .use(decoration11)
//   .use(decoration6)
//   .use(percentPond)
//   .use(decoration7);

new Vue({
  el: "#app",
  router,
  store,
  render: h => h(App)
});
